<template>
  <div class="content">
    <!-- <div class="nav-cum">
      <div class="cum-l">{{resultList.soureName}}</div>
      <div class="cum-r">
        <span>{{resultList.typeName}}</span>
        <span class="el-icon-arrow-right"></span>
        <span>{{resultList.soureName}}</span>
      </div>
    </div> -->
    <div class="main-detail-head">
      <div class="head-l">
        <img :src="resultList.suolueImg" />
      </div>
      <div class="head-r">
        <div class="head-title">{{resultList.soureName}}</div>
        <div class="head-slim">发布时间：{{resultList.updateTime}} 访问次数：{{resultList.clickNum}}</div>
        <div class="head-mian">
          <div class="head-mian-l">
            <div class="h-m-l-name">
              {{resultList.soureDesc}}
              <span>新品</span>
            </div>
            <div class="h-m-gray">
              分类：{{resultList.typeName}}
            </div>
            <div class="h-m-gray">
              格式：{{resultList.soureFormat}}
            </div>
            <div class="h-m-gray">
              说明：{{resultList.soureDesc}}
            </div>
            <div class="h-m-l-name1" style="margin-top: 15px;">
              免责条款：
            </div>
            <div class="h-m-l-name1">
              请合法使用，否则一切法律后果由购买方自行承担
            </div>
            <div class="h-m-l-name1">
              友情提示：
            </div>
            <div class="h-m-l-name1">
              独家定制产品的案例仅供欣赏，概不出售，列出的价格也是该客户支付的定制费用，非对外出售价格
            </div>
            <div class="head-but-list">
              <div class="but-span">
                <a :href="'https://wpa.qq.com/msgrd?v=3&amp;uin='+resultList.contactPro+'&amp;site=qqq&amp;menu=yes'" target="_blank">
                  <div class="but-way">
                    联系客服

                  </div>
                </a>
                如有疑问 请联系客服
              </div>
              <div v-if="isUserInfo.nickName">
                <div class="but-pay" v-if="resultList.prices>0 && resultList.prices<5000 && !resultList.downUrl" @click="butPay(resultList.id)">立即购买</div>
                <a class="but-pay" v-if="resultList.prices>0 && resultList.prices<5000 && resultList.downUrl" target="_blank" :href="resultList.downUrl">立即下载</a>
                <a class="but-pay" v-if="resultList.prices==0 && resultList.downUrl" target="_blank" :href="resultList.downUrl">免费下载</a>
                <div class="but-pay" v-if="resultList.prices==0 && !resultList.downUrl" @click="butPay(resultList.id)">立即购买</div>
              </div>
              <div v-if="!isUserInfo.nickName && resultList.prices<5000 ">
                <div class="but-pay" @click="butPay(resultList.id)">立即下载</div>
              </div>

            </div>
            <div class="head-mian-r">
              <div class="h-m-r-pic">参考价格：
                <span v-if="resultList.prices>0 && resultList.prices<5000">￥{{resultList.prices}}</span>
                <span v-if="resultList.prices==0">免费</span>
                <span v-if="resultList.prices>=5000">联系客服</span>
              </div>
              <!-- <div class="h-m-r-ico ">
                          <span>咨询服务</span>
                       </div> -->
            </div>
          </div>

        </div>

      </div>

    </div>
    <div class="main-detail-aera" v-html="resultList.souredetails">
    </div>

  </div>
</template>

<script>
export default {
  data () {
    return {
      scrollTop: 0,
      resultList: '',
      index: '',
      item: ''
    }
  },
  computed: {
    isUserInfo () {
      var storage_key = localStorage.getItem('storage_key')
      if (storage_key && JSON.parse(storage_key).userInfo) {
        return JSON.parse(storage_key).userInfo
      }
      return this.$store.state.userInfo
    }
  },
  mounted () {
    var e = this.$route.query
    if (e) {
      this.$apis
        .getDetailst({
          id: e.id
        })
        .then(res => {
          this.resultList = res.data.data
          // document.body.addEventListener('scroll', this.scrollLoad, true)
        })
    }
    if (sessionStorage.getItem('item')) {
      this.index = sessionStorage.getItem('index')
      this.item = JSON.parse(sessionStorage.getItem('item'))
    }
  },

  methods: {
    butPay (e) {
      var info = localStorage.getItem('storage_key')
      if (info && JSON.parse(info).userInfo) {
        this.$router.push({ path: './payBuy', query: { id: e } })
      } else {
        this.$message.error('请登录...')
      }
    }
  }
}
</script>

<style lang="less" scoped>
.nav-cum {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #a9a9a9;
  margin: 30px 0px;
  padding: 10px 0px;
}
.cum-l {
  color: #000000;
  font-size: 20px;
}
.cum-r {
  color: #a09e9f;
  font-size: 14px;
  a {
    color: #a09e9f !important;
  }
  a:hover {
    color: #000000 !important;
  }
}
.h-m-l-name1 {
  font-size: 14px;
  color: #08b0bb;
}
.head-l {
  height: 423px;
  line-height: 423px;
  img {
    width: 100%;
    max-height: 100%;
  }
}
.head-r {
}
.main-detail-head {
  background: #fff;
  padding: 30px 60px;
  border-radius: 5px;
  box-sizing: border-box;
  margin: 20px 0px;
  display: grid;
  grid-template-columns: 279px auto;
  grid-gap: 0px 77px;
}

.head-title {
  font-size: 36px;
  font-family: SimHei;
  font-weight: 600;
  color: #000000;
}
.head-slim {
  font-size: 14px;
  font-family: SimHei;
  color: #6d6b6c;
}
.head-mian {
  overflow: hidden;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  margin-top: 42px;
}
.head-mian-l {
  position: relative;
}
.head-mian-r {
  position: absolute;
  top: 10px;
  right: 0px;
}
.h-m-l-name {
  font-size: 18px;
  font-family: SimHei;
  font-weight: 600;
  color: #08b0bb;
  margin-bottom: 25px;
  span {
    border: 1px solid #fd8301;
    color: #fd8301;
    padding: 2px 5px;
    font-size: 14px;
  }
}

.h-m-gray {
  font-size: 12px;
  color: #6d6b6c;
  line-height: 20px;
}
.h-m-r-pic {
  font-size: 14px;
  color: #6d6b6c;
  margin-bottom: 10px;
  span {
    font-size: 38px;
    font-family: SimHei;
    font-weight: 600;
    color: #d92b4a;
  }
}
.h-m-r-ico {
  color: #d92b4a;
  font-size: 26px;
  background: url(../assets/images/t-07.png) no-repeat right 150px top;
  background-size: 44px 40px;
  height: 60px;
  text-align: right;
  span {
    border: 1px solid #d92b4a;
    padding: 2px 5px;
    vertical-align: unset;
    cursor: pointer;
  }
}

.main-detail-aera {
  background: #fff;
  padding: 20px;
  border-radius: 5px;
}

.content {
  min-height: calc(100vh - 230px);
}
</style>
